Skip to content

progress_dashboard: keep distinct same-second snapshots (DASH-SNAPSHOT-COLLISION) - #970

Merged
QemmHD merged 1 commit into
ProjectLeonida:mainfrom
TheGeogeo:fix/dashboard-snapshot-collision
Nov 24, 2026
Merged

QemmHD merged 1 commit into
ProjectLeonida:mainfrom
TheGeogeo:fix/dashboard-snapshot-collision

Conversation

@TheGeogeo

@TheGeogeo TheGeogeo commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: DASH-SNAPSHOT-COLLISION

What and why

Two different dashboard snapshots written in the same UTC second shared an archive path. Use the existing full content hash alongside the UTC stamp in new archive names. This preserves both snapshots and keeps consecutive unchanged snapshots deduplicated. The history and snapshot JSON retain their current schema.

Thanks to xel1uz for the report.

Tested

GPUs tested: n/a. CPU-only synthetic snapshots.

AI-assisted: Yes, Codex.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys, or decryption.
  • Translator contract entry: not applicable.

@KernelSmoker KernelSmoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified submitted head 814381969c12ef11bfe5f9e36c5d963e5fc7e401. The dashboard regression suite passed 51/51 and newline checks 3/3. It confirms distinct snapshots at the same generated timestamp are both archived, while the next snapshot with identical content is deduplicated; history ordering remains correct. check_no_game_data.py and git diff --check passed. Synthetic data only; no GPU/game data.

@kawaii-shakal

Copy link
Copy Markdown
Contributor

Independent test of #970 (DASH-SNAPSHOT-COLLISION)

Head tested: 8143819 (merge base 1504c1a). Environment: Windows 11, native Python 3.13.13, no GPU.

Commands and results:

  • python -I -B tests/test_progress_dashboard.py: Ran 51 tests, OK.
  • python -I -B tests/test_text_write_line_endings.py: OK.
  • Same test file with tools/progress_dashboard.py from the merge base: test_different_snapshots_in_the_same_second_are_preserved FAILS (the second snapshot replaces the first). So the test exercises the change.
  • git merge-tree --write-tree origin/main <head> (origin/main 0af7753): clean, no conflicts.
  • python -I scripts/check_no_game_data.py on the two changed files: exit 0. git diff --check: clean.

Findings:

  • tools/progress_dashboard.py:1028: the fix is minimal and correct. Dedup is still decided by history[-1]["content_hash"] (line 1025), so an unchanged snapshot is still not rewritten (the test's third write_outputs call returning False covers this).
  • Nothing else in the repository parses snapshots/progress_<utc>.json names (only the test globs progress_*.json), so old archives without the hash suffix keep working next to the new ones.
  • Nit, optional: the file name carries the full 64-hex SHA-256, while history.json stores the first 16 characters (line 999). Using [:16] would keep the name shorter (useful under Windows MAX_PATH with a deep --out) and match the history entry. Not blocking.

Verdict: looks good.

AI-assisted.

@QemmHD

QemmHD commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Merging.

Why merged: DASH-SNAPSHOT-COLLISION: progress_dashboard puts the content hash in the snapshot filename, so two different snapshots taken in the same second are both kept instead of one overwriting the other. kawaii-shakal checked it (51 OK) and KernelSmoker approved it.

Why it's good: test_progress_dashboard and the line-ending test: 54 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 6293c1c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 571 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

@QemmHD
QemmHD merged commit 2fd2c0e into ProjectLeonida:main Nov 24, 2026
1 check passed
@TheGeogeo

Copy link
Copy Markdown
Contributor Author

thegeogeo

@TheGeogeo
TheGeogeo deleted the fix/dashboard-snapshot-collision branch November 25, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants